package chen.yi.web;

import chen.yi.component.log.utils.ThreadMdcUtil;
import com.alibaba.ttl.threadpool.TtlExecutors;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.Map;
import java.util.concurrent.Executor;

/**
 * 启动类
 * @author huatao
 */
@SpringBootApplication
@Slf4j
@EnableAsync
public class ChenYiApplication {
    public static void main(String[] args) {
        SpringApplication.run(ChenYiApplication.class, args);
        log.info("启动成功");
    }

    @Bean(name = "testTreadPool")
    public Executor   testTreadPool() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        //省略其他参数

        return executor;
    }
}
